<template>
    <a-card :bordered="false">

        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
            <a-form layout="inline" @keyup.enter.native="searchQuery">
                <a-row :gutter="24">
                    <template>
                        <a-col :md="6" :sm="8">
                            <a-form-item label="下级平台标识">
                                <a-input placeholder="请输入下级标识查询" v-model="queryParam.deviceGBId"></a-input>
                            </a-form-item>
                        </a-col>
                    </template>

                    <a-col :md="6" :sm="8">
						<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
							<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
							<a-button type="primary" @click="resetParam" icon="reload" style="margin-left: 8px">重置
							</a-button>
						</span>
                    </a-col>

                </a-row>
            </a-form>
        </div>

        <!-- 操作按钮区域 -->
        <div class="table-operator" style="border-top: 5px">
        </div>

        <!-- table区域-begin -->
        <div>
            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
                <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a
                    style="font-weight: 600">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
            </div>

            <a-table ref="table" bordered size="middle" rowKey="devId" :columns="columns" :dataSource="dataSource"
                     :pagination="ipagination" :loading="loading"
                     :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                     @change="handleTableChange">
				
				<span slot="action2" slot-scope="text, record">
					<a @click="cameraList(record)">管理</a>
				</span>

            </a-table>
        </div>
        <!-- table区域-end -->
        <platform-add-modal ref="modalForm" @ok="modalFormOk"></platform-add-modal>
        <platform-edit-modal ref="deveditmodal" @ok="editModalOk"></platform-edit-modal>
    </a-card>
</template>

<script>
    import {
        JeecgListMixin
    } from '@/mixins/JeecgListMixin'
    import {
        getAction,
        postAction
    } from '@/api/manage'

    export default {
        name: "PlatformLowerList",
        mixins: [JeecgListMixin],
        data() {
            return {
                description: '这是下级平台列表页面',
                queryParam: {
                    deviceGBId: undefined,
                    modelId: undefined,
                    online: undefined
                },
                modelList: [],
                columns: [
                    {
                        title: '下级平台标识',
                        align: "center",
                        width: 60,
                        dataIndex: 'deviceGBId'
                    },
                    {
                        title: 'IP地址',
                        align: "center",
                        width: 60,
                        dataIndex: 'deviceIp'
                    },
                    {
                        title: '端口',
                        align: "center",
                        width: 60,
                        dataIndex: 'devicePort'
                    },
                    {
                        title: '信令传输模式',
                        align: "center",
                        width: 60,
                        dataIndex: 'transport'
                    },
                    {
                        title: '字符集',
                        align: "center",
                        width: 60,
                        dataIndex: 'characterSet'
                    }
                ],
                url: {
                    list: "/platform/page-lower"
                },
            }
        },
        methods: {
            addDev: function () {
                this.$refs.modalForm.show();
                this.$refs.modalForm.disableSubmit = false;
                this.$refs.modalForm.modelList = this.modelList;
            },
            modalFormOk() {
                // 新增/修改 成功时，重载列表
                this.loadData();
            },
            editDev: function (record) {
                this.$refs.deveditmodal.show(record);
                this.$refs.deveditmodal.disableSubmit = false;
                this.$refs.deveditmodal.modelList = this.modelList;
            },
            editModalOk() {
                // 修改 成功时，重载列表
                this.loadData();
            },
            handleMenuClick(e) {
                if (e.key == 1) {
                    this.batchDel();
                }
            },
            resetParam() {
                this.queryParam = {}
                this.queryParam.userType = undefined
                this.loadData(1)
            },
        }
    }
</script>
<style scoped>
    @import '~@assets/less/common.less'
</style>
